<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<th:block th:fragment="showMenu(menus)">
    <x th:each="menu : ${menus.child}">
    <li class="kd-nav" th:if="${#lists.size(menu.child)}==0"> <a class="multitabs" th:href='@{${menu.url}(id=${menu.id})}' th:attr="data-href=${menu.url},data-title=${menu.title},data-id=${menu.id}"  th:text="${menu.title}">一级菜单</a> </li>
    <li th:if="${#lists.size(menu.child)}>0" class="nav-item nav-item-has-subnav">
        <a href="javascript:void(0)">
            <i class="mdi mdi-menu"></i><span th:attr="data-title=${menu.title}" th:text="${menu.title}">二级菜单</span>
        </a>
        <ul  class="nav nav-subnav">
            <th:block th:replace="common/menuutil::showMenu(${menu})"></th:block>
        </ul>
    </li>
    </x>
</th:block>

</body>
</html>